package cn.e4j;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

/**
 * SpringBoot方式启动类
 *
 * @author wenchuan.li
 * @Date 2018/5/21 12:06
 */

@SpringBootApplication(
        exclude = {
                DruidDataSourceAutoConfigure.class}
)
@MapperScan(basePackages = {"cn.e4j.modular.system.dao", "cn.e4j.modular.*.mapper"})
@EnableAsync
public class E4jApplication {

    private final static Logger logger = LoggerFactory.getLogger(E4jApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(E4jApplication.class, args);
        logger.info("******** Application is success ********");
    }

    /**
     * 服务器时区设置
     * 解决服务端时差问题
     */
    @PostConstruct
    void setDefaultTimezone() {
        TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
    }
}
